Optimal. Leaf size=226 \[ -\frac {c g (3-4 p) \, _2F_1\left (\frac {1}{2},\frac {1-p}{2};\frac {3-p}{2};\cos ^2(e+f x)\right ) (g \sec (e+f x))^{-1+p} \sin (e+f x)}{3 a^2 f \sqrt {\sin ^2(e+f x)}}+\frac {c (5-4 p) \, _2F_1\left (\frac {1}{2},-\frac {p}{2};\frac {2-p}{2};\cos ^2(e+f x)\right ) (g \sec (e+f x))^p \sin (e+f x)}{3 a^2 f \sqrt {\sin ^2(e+f x)}}-\frac {c (5-4 p) (g \sec (e+f x))^p \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac {2 c (g \sec (e+f x))^p \tan (e+f x)}{3 f (a+a \sec (e+f x))^2} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.29, antiderivative size = 226, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 4, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {4105, 3872,
3857, 2722} \begin {gather*} -\frac {c g (3-4 p) \sin (e+f x) (g \sec (e+f x))^{p-1} \, _2F_1\left (\frac {1}{2},\frac {1-p}{2};\frac {3-p}{2};\cos ^2(e+f x)\right )}{3 a^2 f \sqrt {\sin ^2(e+f x)}}+\frac {c (5-4 p) \sin (e+f x) (g \sec (e+f x))^p \, _2F_1\left (\frac {1}{2},-\frac {p}{2};\frac {2-p}{2};\cos ^2(e+f x)\right )}{3 a^2 f \sqrt {\sin ^2(e+f x)}}-\frac {c (5-4 p) \tan (e+f x) (g \sec (e+f x))^p}{3 a^2 f (\sec (e+f x)+1)}-\frac {2 c \tan (e+f x) (g \sec (e+f x))^p}{3 f (a \sec (e+f x)+a)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2722
Rule 3857
Rule 3872
Rule 4105
Rubi steps
\begin {align*} \int \frac {(g \sec (e+f x))^p (c-c \sec (e+f x))}{(a+a \sec (e+f x))^2} \, dx &=-\frac {2 c (g \sec (e+f x))^p \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}+\frac {\int \frac {(g \sec (e+f x))^p (a c (3-2 p)-2 a c (1-p) \sec (e+f x))}{a+a \sec (e+f x)} \, dx}{3 a^2}\\ &=-\frac {c (5-4 p) (g \sec (e+f x))^p \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac {2 c (g \sec (e+f x))^p \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}+\frac {\int (g \sec (e+f x))^p \left (a^2 c (3-4 p) (1-p)+a^2 c (5-4 p) p \sec (e+f x)\right ) \, dx}{3 a^4}\\ &=-\frac {c (5-4 p) (g \sec (e+f x))^p \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac {2 c (g \sec (e+f x))^p \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}+\frac {(c (3-4 p) (1-p)) \int (g \sec (e+f x))^p \, dx}{3 a^2}+\frac {(c (5-4 p) p) \int (g \sec (e+f x))^{1+p} \, dx}{3 a^2 g}\\ &=-\frac {c (5-4 p) (g \sec (e+f x))^p \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac {2 c (g \sec (e+f x))^p \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}+\frac {\left (c (3-4 p) (1-p) \left (\frac {\cos (e+f x)}{g}\right )^p (g \sec (e+f x))^p\right ) \int \left (\frac {\cos (e+f x)}{g}\right )^{-p} \, dx}{3 a^2}+\frac {\left (c (5-4 p) p \left (\frac {\cos (e+f x)}{g}\right )^p (g \sec (e+f x))^p\right ) \int \left (\frac {\cos (e+f x)}{g}\right )^{-1-p} \, dx}{3 a^2 g}\\ &=-\frac {c (3-4 p) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1-p}{2};\frac {3-p}{2};\cos ^2(e+f x)\right ) (g \sec (e+f x))^p \sin (e+f x)}{3 a^2 f \sqrt {\sin ^2(e+f x)}}+\frac {c (5-4 p) \, _2F_1\left (\frac {1}{2},-\frac {p}{2};\frac {2-p}{2};\cos ^2(e+f x)\right ) (g \sec (e+f x))^p \sin (e+f x)}{3 a^2 f \sqrt {\sin ^2(e+f x)}}-\frac {c (5-4 p) (g \sec (e+f x))^p \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}-\frac {2 c (g \sec (e+f x))^p \tan (e+f x)}{3 f (a+a \sec (e+f x))^2}\\ \end {align*}
________________________________________________________________________________________
Mathematica [F]
time = 11.16, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {(g \sec (e+f x))^p (c-c \sec (e+f x))}{(a+a \sec (e+f x))^2} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.22, size = 0, normalized size = 0.00 \[\int \frac {\left (g \sec \left (f x +e \right )\right )^{p} \left (c -c \sec \left (f x +e \right )\right )}{\left (a +a \sec \left (f x +e \right )\right )^{2}}\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} - \frac {c \left (\int \left (- \frac {\left (g \sec {\left (e + f x \right )}\right )^{p}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\right )\, dx + \int \frac {\left (g \sec {\left (e + f x \right )}\right )^{p} \sec {\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx\right )}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.00 \begin {gather*} \int \frac {\left (c-\frac {c}{\cos \left (e+f\,x\right )}\right )\,{\left (\frac {g}{\cos \left (e+f\,x\right )}\right )}^p}{{\left (a+\frac {a}{\cos \left (e+f\,x\right )}\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________